package org.example.service;


import org.example.mapper.ClassMapper;
import org.example.model.ClassInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassService {
    @Autowired
    private ClassMapper classMapper;

    public int addClass(ClassInfo classInfo) {
        return classMapper.insertClass(classInfo);
    }

    public int updateClass(ClassInfo classInfo) {
        return classMapper.updateClass(classInfo);
    }

    public int deleteClass(Long id) {
        return classMapper.deleteClass(id);
    }

    public ClassInfo getClassById(Long id) {
        return classMapper.getClassById(id);
    }

    public List<ClassInfo> getAllClasses() {
        return classMapper.getAllClasses();
    }
}